<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="author" content="wangbo">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>编写组件</title>
</head>
<body>
    <div id="app"></div>
    <!-- 引入3个库文件 -->
    <!-- react开发依赖库 -->
    <script src="../js/react.development.js"></script>
    <!-- react dom操作库 -->
    <script src="../js/react-dom.development.js"></script>
    <!-- 解析jsx语法的库 还有将es6 转化成es5 -->
    <script src="../js/babel.min.js"></script>
    <!-- ctrl shift y 全部小写 -->
    <script type="text/babel">
    // 开头必须大写,默认大写是react的组件,小写默认是html的标签
    function Mycomponent() {
        return <h1>我是组件</h1>
    }
    ReactDOM.render(<Mycomponent />,document.getElementById('app'))
    </script>
</body>
</html>